package com.cwf.auth.mapper;

import com.cwf.auth.domain.Permission;
import com.cwf.auth.domain.Role;
import com.cwf.auth.dto.RoleMenuDTO;
import com.cwf.auth.dto.RolePermissionDTO;
import com.cwf.basic.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cwf
 * @since 2023-12-01
 */
public interface RoleMapper extends BaseMapper<Role> {

    void saveAuth(RolePermissionDTO rolePermissionDTO);

    void deletePermissionByRoleId(RolePermissionDTO rolePermissionDTO);

    List<Long> getPermissionsById(Long id);

    void deleteMenuByRoleId(RoleMenuDTO roleMenuDTO);

    void saveMenu(RoleMenuDTO roleMenuDTO);

    List<Long> getMenusById(Long id);

    void truncatePermissionsByRoleId(Serializable id);

    void truncateMenusByRoleId(Serializable id);

    void truncatePermissionsByIds(@Param("ids") List<Long> ids);

    void truncateMenusByIds(@Param("ids") List<Long> ids);
}
